<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="/pages/templates/MainTemplate.xhtml">
		<ui:define name="content">
			<h:form id="noti_form">
				<p:dataTable id="notitable" value="#{notificationMB.tasks}" var="task"
					emptyMessage="No tiene notificaciones" paginator="true" rows="12"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="9,12,15" paginatorPosition="bottom">
					<p:column id="fecha_creacion_id" headerText="Fecha">
						<h:outputText value="#{task.createTime}">
							<f:convertDateTime type="date" pattern="dd-MM-yyyy HH-mm" />
						</h:outputText>
					</p:column>
					<p:column id="desc_id" headerText="Descripcion de la tarea" style="word-wrap:break-word;">
						<p:outputLabel value="#{task.description}"></p:outputLabel>
					</p:column>
					<p:column id="resp_id" headerText="Responsable">
						<p:outputLabel value="#{task.assignee}" rendered="#{! empty task.assignee}"></p:outputLabel>
						<p:commandLink value="Reclamar" rendered="#{empty task.assignee}"
							action="#{notificationMB.claimTask(task.id)}" update=":noti_form:notitable">
						</p:commandLink>
					</p:column>
					<p:column id="acion" headerText="">
						<h:outputLink value="aprobacion.xhtml" rendered="#{task.assignee == notificationMB.userId}">
							<h:outputText value="Ver"></h:outputText>
							<f:param name="taskId" value="#{task.id}" />
							<f:param name="executionId" value="#{task.executionId}" />
							<f:param name="taskDefKey" value="#{task.taskDefinitionKey}" />
							<f:param name="taskDescription" value="#{task.description}" />
						</h:outputLink>
					</p:column>
				</p:dataTable>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>